<?php
sfLoader::loadHelpers('CrossAppLinkTo');
/**
 * backend actions.
 *
 * @package    travelbug
 * @subpackage backend
 * @author     David J. Sloan
 * @version    SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
 */
class backendActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    //$this->forward('default', 'module');
    
    //$this->redirect(cross_app_link_to('backend', '@operator_login'));
   //echo  $this->getUser()->getProfile()->getUsertype();
   if ($this->getUser()->getProfile()->getUsertype()==2){
   	 $this->redirect("operator/index");
   } elseif ($this->getUser()->getProfile()->getUsertype()==1){
   	 $this->redirect("traveler/index");
   }
  }
  
  public function executeLogout(sfWebrequest $request)
  {
  	$this->getUser()->signOut();
  	$this->redirect("main/index");
  }
}
